import App from '../app'
/**
 * auth true登录才能访问，false不需要登录，默认true
 */
// require.ensure 是 Webpack 的特殊语法，用来设置 code-split point
const Home = resolve => {
    require.ensure(['../views/homePage'], () => {
        resolve(require('../views/homePage'));
    });
};
export default [
    {
        path: '/',
        name: 'index',
        component: App,
        children: [
            {
                path: '/home', //登录
                name: 'home',
                meta: { auth: false },
                component: Home
            },
            {
                path: '/search',
                name: 'search',
                component(resolve) {
                    require.ensure(['../views/search'], () => {
                        resolve(require('../views/search'));
                    })
                }
            },
            {
                path: '*', //其他页面，强制跳转到登录页面
                redirect: '/home'
            }
        ]
    }
]